<?php
class SampleController extends AppController{
	var $name = "Sample";
	var $usees = array("Sample");
	var $layout = 'default';

	function index(){

	  
	}

	function action(){
		$kisanuki = 0;

	}

	function takeshi(){
		var_dump($GLOBALS['aaa']);
	//	$_DB->Test();

	//	$a = new DB();
	//	$a->Test();
		return;
try {
    // MySQLサーバへ接続
    $pdo = new PDO("mysql:host=localhost; dbname=test", "root", "");
    $stmt = $pdo->query("SELECT * FROM test");
   	while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
    	var_dump( $row);
   	}


} catch(PDOException $e){
    var_dump($e->getMessage());
}

// 切断
$pdo = null;

		$this->set('name', 'kchiro');

	}

	function takeshi2(){
		$conn = mysql_connect('localhost', 'root', '', 'test');
		mysql_select_db( 'test', $conn );


		$res_result = mysql_query("SELECT * from test", $conn );


		while( $row = mysql_fetch_array( $res_result, MYSQL_ASSOC ) ){
			var_dump( $row );
		}

		mysql_close( $conn );


	//	var_dump($arr);
		$this->set('name', 'ichiro');
	//	var_dump($this->viewVars);

	}


	function fff($arg1, $arg2){
		var_dump('1111'.$arg1);
		var_dump($arg2);
	}
}